Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OnPacketReceived to pseudocode #3653

Merged
merged 9 commits into from May 19, 2020
Merged

Conversation

ianswett
Copy link
Contributor

@ianswett ianswett commented May 13, 2020

Pseudocode for re-arming the PTO when "If no additional data can be sent, the server's PTO timer MUST NOT be armed until datagrams have been received from the client, because packets sent on PTO count against the anti-amplification limit. "

I'll note that OnPacketReceived actually needs to do a lot more than this, but this is the portion relevant to PTO.

Fixes #3639

Pseudocode for re-arming the PTO when "If no additional data can be sent, the server's PTO timer MUST NOT be armed until datagrams have been received from the client, because packets sent on PTO count against the anti-amplification limit. "
@ianswett ianswett added editorial An issue that does not affect the design of the protocol; does not require consensus. -recovery labels May 13, 2020
@ianswett ianswett requested a review from janaiyengar May 13, 2020 13:47
Copy link
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. I have one tweak that I think you need and maybe a tweak that you want.

The first is about the argument and what information is passed. I think that this is just a notification from the main packet processing code, so it doesn't need to include packet processing.

The second is more involved and would involve adding more state variables.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
Psuedocode for OnPacketReceived follows:

~~~
OnPacketReceived(packet):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would drop the argument to this. Because this needs to be a datagram not a packet.

That means the function at the end should be called ProcessPackets(datagram) if you keep it. But I would suggest that you don't need to do packet processing in this logic: this is just a function where the loss recovery code is told about what is happening in the main code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. You don't need to process packets in here, just say up above that this function is called even if the received packet is undecryptable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method renamed and comment updated.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
Psuedocode for OnPacketReceived follows:

~~~
OnPacketReceived(packet):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. You don't need to process packets in here, just say up above that this function is called even if the received packet is undecryptable.

Copy link
Contributor Author

@ianswett ianswett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks everyone, updated based on comments. PTAL.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
Psuedocode for OnPacketReceived follows:

~~~
OnPacketReceived(packet):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method renamed and comment updated.

Copy link
Member

@martinthomson martinthomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A rewording suggestion; and a minor error correction.

draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
draft-ietf-quic-recovery.md Outdated Show resolved Hide resolved
ianswett and others added 3 commits May 17, 2020 20:19
Co-authored-by: Martin Thomson <mt@lowentropy.net>
Co-authored-by: Martin Thomson <mt@lowentropy.net>
ianswett and others added 2 commits May 19, 2020 10:26
When a server is blocked by anti-amplification limits, receiving
a datagram unblocks it, even if none of the packets in the
datagram are successfully processed. In such a case, the PTO
timer may need to be armed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would it not be armed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought a padded ACK-only packet could hit the limit without bytes in flight, but I realize that each full-sized ACK allows 3 packets to be sent. Updating text.

@ianswett ianswett merged commit ff55a16 into master May 19, 2020
@ianswett ianswett deleted the ianswett-onpacketreceived branch May 19, 2020 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-recovery editorial An issue that does not affect the design of the protocol; does not require consensus.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Server's first flight should be capped by INITCWND
4 participants